#ifndef DATATRANS_TASK_H
#define DATATRANS_TASK_H

 #include "main.h"
#define NUC_RX_BUF_NUM  13*2
#define NUC_TX_BUF_NUM  22
//数据帧头尾
typedef enum
{
		Frame_Head = 'S',
		Frame_End  = 'E',
}NUC_Frame_e;
//颜色
typedef enum
{
    OwnColor_RED = '0',
    Owncolor_BLE = '1',
    Owncolor_DeBug = '2',	
}NUC_OwnColor_e;

//NUC模式
typedef enum
{
	NUC_Aiming_Mode = '0',
	NUC_SmallEnergy_Mode = '1',
	NUC_BigEnergy_Mode = '2',
	NUC_GuardStrike_Mode = '3',
	NUC_SpinningStrike_Mode = '4',
	NUC_VideoRecord_Mode = '5',
	NUC_DroneStrike_Mode = '6',
	NUC_Guard_Mode = '7',
	NUC_Radar_Mode = '8',
}NUC_Mode_e;

//机器人ID
typedef enum
{
	NUC_OwnID_Hero = '0',
	NUC_OwnID_Labour = '1',
	NUC_OwnID_Infantry = '2',
	NUC_OwnID_Drone = '3',
	NUC_OwnID_Guard = '4',
}NUC_OwnID_e;

typedef enum
{

	Target_Missing = 0x00,
	Target_Catch   = 0x01,

}NUC_Mark_e;

typedef enum
{

	Shoot_Stop  = 0x00,
	Shoot_Allow = 0x01,

}NUC_Shoot_e;


//NUC通信数据结构体
typedef struct
{
	uint8_t Head;

	NUC_OwnColor_e Curr_Color;

	NUC_Mode_e Curr_Mode;

	NUC_OwnID_e Curr_ID;

	uint8_t Yaw_Angle[4];

	uint8_t Pitch_Angle[4];

	uint8_t Yaw_Speed[4];

	uint8_t Pitch_Speed[4];

	uint8_t Bullet_Speed;

	uint8_t End;
} NUC_data_Tx_t;

typedef struct
{

	uint8_t detect_Mark;
	uint8_t Shoot_Cmd;
	uint8_t Yaw_Sign;
	int Yaw_angle;
	uint8_t Pitch_Sign;
	int Pitch_angle;
	int Depth;
	uint8_t Rece_CRC;
} NUC_data_Rx_t;

typedef struct{
	NUC_data_Rx_t NUC_data_Rx;
	NUC_data_Tx_t NUC_data_Tx;
} NUC_data_t;


void  NUC_Sys_Init(void);      //NUC通信初始化
void  ARMOR_Applicate(NUC_data_t *SPC);
void  Big_Energy_Applicate(NUC_data_t *SPC);
void  Small_Energy_Applicate(NUC_data_t *SPC);
void  Ban_Applicate(void);
void  Scan_data_RX(void);
void  Scan_Role_RX(void);
void NUC_SendData(NUC_data_t *SPC);
NUC_data_t *get_NUC_data_point(void);  //获取NUC数据指针

#endif

